package hu.bme.mit.inf.expendables.entities;
	
import javax.persistence.*;
import hu.bme.mit.inf.expendables.entities.*;
import java.util.List;
import java.util.ArrayList;


@Entity
@Table(name="T_APPSUPERVISION")
@NamedQueries(
	{
	@NamedQuery(name=AppSupervision.GET_APPSUPERVISION,query="SELECT a FROM AppSupervision a WHERE a.appSupervisionId = :appSupervisionId"),
	@NamedQuery(name=AppSupervision.DELETE_APPSUPERVISION,query="DELETE FROM AppSupervision a WHERE a.appSupervisionId = :appSupervisionId"),
	@NamedQuery(name=AppSupervision.UPDATE_APPSUPERVISION_APPNAME,query="UPDATE AppSupervision a SET a.hasBeenSupervised_appName = :hasBeenSupervised_appName, a.appNameProblemDescription = :appNameProblemDescription, a.supervisor_appName = :appNameSupervisor WHERE a.appSupervisionId = :appSupervisionId"),
	@NamedQuery(name=AppSupervision.UPDATE_APPSUPERVISION_METADATA,query="UPDATE AppSupervision a SET a.hasBeenSupervised_metadata = :hasBeenSupervised_metadata, a.metadataProblemDescription = :metadataProblemDescription, a.supervisor_metadata = :appMetadataSupervisor WHERE a.appSupervisionId = :appSupervisionId"),
	@NamedQuery(name=AppSupervision.UPDATE_APPSUPERVISION_TEST,query="UPDATE AppSupervision a SET a.hasBeenSupervised_appTest = :hasBeenSupervised_appTest, a.appTestProblemDescription = :appTestProblemDescription, a.supervisor_appTest = :appTestSupervisor WHERE a.appSupervisionId = :appSupervisionId")
	})
public class AppSupervision {
	                        	
	public static final String GET_APPSUPERVISION = "GetAppSupervision";
	public static final String DELETE_APPSUPERVISION = "DeleteAppSupervision";
	public static final String UPDATE_APPSUPERVISION_APPNAME = "UpdateAppSupervisionAppNam";
	public static final String UPDATE_APPSUPERVISION_METADATA = "UpdateAppSupervisionMetadata";
	public static final String UPDATE_APPSUPERVISION_TEST = "UpdateAppSupervisionTest";

	//Attributes
	private String appNameProblemDescription;
	
	private String metadataProblemDescription;
	
	private String appTestProblemDescription;
	
	@Id
	@GeneratedValue
	@Column(name="APPSUPERVISION_ID")
	private long appSupervisionId;
	
	private Boolean hasBeenSupervised_appName;
	
	private Boolean hasBeenSupervised_metadata;
	
	private Boolean hasBeenSupervised_appTest;
	

	//Reference to AppMetadata
	@OneToOne(mappedBy="supervision")
	private AppMetadata appMetadata;
	
	//Reference to Manager
	@ManyToOne
	@JoinColumn(name = "SUPERVISOR_ID_APPNAME")
	private Manager supervisor_appName;
	
	//Reference to Manager
	@ManyToOne
	@JoinColumn(name = "SUPERVISOR_ID_METADATA")
	private Manager supervisor_metadata;
	
	//Reference to Manager
	@ManyToOne
	@JoinColumn(name = "SUPERVISOR_ID_APPTEST")
	private Manager supervisor_appTest;
	


	//Getters and Setters
	public String getAppNameProblemDescription(){
		return appNameProblemDescription;
	}
	
	public void setAppNameProblemDescription(String appNameProblemDescription){
		this.appNameProblemDescription = appNameProblemDescription;
	}
	
	public String getMetadataProblemDescription(){
		return metadataProblemDescription;
	}
	
	public void setMetadataProblemDescription(String metadataProblemDescription){
		this.metadataProblemDescription = metadataProblemDescription;
	}
	
	public String getAppTestProblemDescription(){
		return appTestProblemDescription;
	}
	
	public void setAppTestProblemDescription(String appTestProblemDescription){
		this.appTestProblemDescription = appTestProblemDescription;
	}
	
	public long getAppSupervisionId(){
		return appSupervisionId;
	}
	
	public void setAppSupervisionId(long appSupervisionId){
		this.appSupervisionId = appSupervisionId;
	}
	
	public Boolean getHasBeenSupervised_appName(){
		return hasBeenSupervised_appName;
	}
	
	public void setHasBeenSupervised_appName(Boolean hasBeenSupervised_appName){
		this.hasBeenSupervised_appName = hasBeenSupervised_appName;
	}
	
	public Boolean getHasBeenSupervised_metadata(){
		return hasBeenSupervised_metadata;
	}
	
	public void setHasBeenSupervised_metadata(Boolean hasBeenSupervised_metadata){
		this.hasBeenSupervised_metadata = hasBeenSupervised_metadata;
	}
	
	public Boolean getHasBeenSupervised_appTest(){
		return hasBeenSupervised_appTest;
	}
	
	public void setHasBeenSupervised_appTest(Boolean hasBeenSupervised_appTest){
		this.hasBeenSupervised_appTest = hasBeenSupervised_appTest;
	}
	

	public AppMetadata getAppMetadata(){
		return appMetadata;
	}
	
	public void setAppMetadata(AppMetadata appMetadata){
		this.appMetadata = appMetadata;
	}
		
	public Manager getSupervisor_appName(){
		return supervisor_appName;
	}
	
	public void setSupervisor_appName(Manager supervisor_appName){
		this.supervisor_appName = supervisor_appName;
	}
		
	public Manager getSupervisor_metadata(){
		return supervisor_metadata;
	}
	
	public void setSupervisor_metadata(Manager supervisor_metadata){
		this.supervisor_metadata = supervisor_metadata;
	}
		
	public Manager getSupervisor_appTest(){
		return supervisor_appTest;
	}
	
	public void setSupervisor_appTest(Manager supervisor_appTest){
		this.supervisor_appTest = supervisor_appTest;
	}
		
}